import { createApp } from "vue";
import Message from "@/components/Message.vue";
export type MessageType = "success" | "error" | "default";
export default (message: string, type: MessageType, timeout = 2000) => {
    const messageInstance = createApp(Message, { message, type });
    const elNode = document.createElement("div");
    document.body.appendChild(elNode);
    messageInstance.mount(elNode);
    setTimeout(() => {
        messageInstance.unmount(elNode);
        document.body.removeChild(elNode);
    }, timeout);
};
